/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.openbravo.pos.inventory.model;

import cn.ekuma.data.ui.swing.AbstractDTOTableModel;

import com.openbravo.bean.ProductCustomerCategoryPrice;
import com.openbravo.format.Formats;
import com.openbravo.pos.base.AppLocal;

/**
 *
 * @author Administrator
 */
public class ProductCustomerCategoryPriceModel extends AbstractDTOTableModel<ProductCustomerCategoryPrice>{

    public String[] getColumnNames() {
        return new String[] {
        AppLocal.getIntString("label.prodcategory"),
        AppLocal.getIntString("label.prodpricesell"),
        AppLocal.getIntString("label.WholesalePrice")};
    }


    public Object getValueAt(int rowIndex, int columnIndex) {
         ProductCustomerCategoryPrice p=this.getObj(rowIndex);
         switch(columnIndex){
             case 0:
                 return p.getCustomerCategory().getName();
             case 1:
                 return Formats.CURRENCY.formatValue(p.getM_dCustomerCategoryPrice());
             case 2:
                 return Formats.CURRENCY.formatValue(p.getM_dWholesalePrice());
         }
         return null;
    }

}
